package com.feihao.zhou.service.impl;

import com.feihao.zhou.dao.AccountDao;
import com.feihao.zhou.domain.Account;
import com.feihao.zhou.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@PropertySource("classpath:list.properties")
@Service("accountService")
public class AccountServiceImpl implements AccountService {


   /* @Value("${test.list.split(',')}")*/
   /* @Autowired*/

    @Value("#{'${test.list}'.split(',')}")
    private List<String> list ;

   /* @Value("#{${test.maps}}")
    private Map<String,String> maps;*/

    @Autowired
    private AccountDao accountDao;
    public Integer save(Account account) {
        return accountDao.save(account);
    }

    public Integer delete(Integer id) {
        return accountDao.delete(id);
    }

    public List<Account> findAll() {
        return accountDao.findAll();
    }

    public Account findById(Integer id) {
        return accountDao.findById(id);
    }

    public Integer update(Account account) {
        return accountDao.update(account);
    }

    public void test(){
        System.out.println(list);
//        System.out.println(maps);
    }
}
